#include "udproom.h"
#include "ui_udproom.h"

UdpRoom::UdpRoom(QTcpSocket *client, const QString user_name, const QString room_id,
                 bool isOwner, const QString owner_name, QWidget *parent) :
    QWidget(parent),
    client(client),
    user_name(user_name),
    room_id(room_id),
    isOwner(isOwner),
    owner_name(owner_name),
    ui(new Ui::UdpRoom)
{
    ui->setupUi(this);
    this->setWindowTitle("房主名：" + owner_name);
}


UdpRoom::~UdpRoom()
{
    delete ui;
}

// 开启直播
void UdpRoom::on_pushButton_2_clicked()
{
    if(false == isOwner){
        QMessageBox::warning(this, "Start live streaming", "You do not have permission to start live streaming!");
        return;
    }
}


// 关闭直播
void UdpRoom::on_pushButton_3_clicked()
{
    if(false == isOwner){
        QMessageBox::warning(this, "Close live streaming", "You do not have permission to close live streaming!");
        return;
    }
}
